package lab02.test21;

/**
 * Created by mac on 2017/11/1.
 */
public class Test {

    //

    public static int str(String str,char c) {

        int count = 0;

        for (int i = 0;i<str.length();i++){

            if(str.charAt(i) == c){

                count ++;

            }
        }

        return count;

    }

    public static void main(String[] args) {

        System.out.println(new Test().str("weao to y",'o'));

    }

}
